package com.beimin.evedata.model.chr;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.beimin.evedata.model.map.MapConstellation;
import com.beimin.evedata.model.map.MapRegion;
import com.beimin.evedata.model.map.MapSolarSystem;

@Entity
@Table(name = "chrfactions")
public class ChrFaction implements java.io.Serializable {
	private int id;
	private String factionName;
	private String description;
	private Integer raceIds;
	private Integer solarSystemId;
	private Integer corporationId;
	private Double sizeFactor;
	private Integer stationCount;
	private Integer stationSystemCount;
	private Set<MapSolarSystem> solarSystems = new HashSet<MapSolarSystem>(0);
	private Set<MapRegion> regions = new HashSet<MapRegion>(0);
	private Set<MapConstellation> constellations = new HashSet<MapConstellation>(0);

	public ChrFaction() {
	}

	public ChrFaction(int id) {
		this.id = id;
	}

	public ChrFaction(int id, String factionName, String description, Integer raceIds, Integer solarSystemId, Integer corporationId, Double sizeFactor,
			Integer stationCount, Integer stationSystemCount, Set<MapSolarSystem> mapsolarsystemses, Set<MapRegion> mapregionses,
			Set<MapConstellation> mapconstellationses) {
		this.id = id;
		this.factionName = factionName;
		this.description = description;
		this.raceIds = raceIds;
		this.solarSystemId = solarSystemId;
		this.corporationId = corporationId;
		this.sizeFactor = sizeFactor;
		this.stationCount = stationCount;
		this.stationSystemCount = stationSystemCount;
		this.solarSystems = mapsolarsystemses;
		this.regions = mapregionses;
		this.constellations = mapconstellationses;
	}

	@Id
	@Column(name = "factionID", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "factionName", length = 100)
	public String getFactionName() {
		return this.factionName;
	}

	public void setFactionName(String factionName) {
		this.factionName = factionName;
	}

	@Column(name = "description", length = 1000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "raceIDs")
	public Integer getRaceIds() {
		return this.raceIds;
	}

	public void setRaceIds(Integer raceIds) {
		this.raceIds = raceIds;
	}

	@Column(name = "solarSystemID")
	public Integer getSolarSystemId() {
		return this.solarSystemId;
	}

	public void setSolarSystemId(Integer solarSystemId) {
		this.solarSystemId = solarSystemId;
	}

	@Column(name = "corporationID")
	public Integer getCorporationId() {
		return this.corporationId;
	}

	public void setCorporationId(Integer corporationId) {
		this.corporationId = corporationId;
	}

	@Column(name = "sizeFactor", precision = 22, scale = 0)
	public Double getSizeFactor() {
		return this.sizeFactor;
	}

	public void setSizeFactor(Double sizeFactor) {
		this.sizeFactor = sizeFactor;
	}

	@Column(name = "stationCount")
	public Integer getStationCount() {
		return this.stationCount;
	}

	public void setStationCount(Integer stationCount) {
		this.stationCount = stationCount;
	}

	@Column(name = "stationSystemCount")
	public Integer getStationSystemCount() {
		return this.stationSystemCount;
	}

	public void setStationSystemCount(Integer stationSystemCount) {
		this.stationSystemCount = stationSystemCount;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "faction")
	public Set<MapSolarSystem> getSolarSystems() {
		return this.solarSystems;
	}

	public void setSolarSystems(Set<MapSolarSystem> solarSystems) {
		this.solarSystems = solarSystems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "faction")
	public Set<MapRegion> getRegions() {
		return this.regions;
	}

	public void setRegions(Set<MapRegion> regions) {
		this.regions = regions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "faction")
	public Set<MapConstellation> getConstellations() {
		return this.constellations;
	}

	public void setConstellations(Set<MapConstellation> constellations) {
		this.constellations = constellations;
	}

}
